import React, { Component } from 'react';
import HomePage from './HomePage';
import ConsumerPage from './ConsumerPage';
import { ThemeProvider, UserProvider } from '../Context';

export default class ContextPage extends Component {
  constructor(props) {
    super(props);
    this.state = {
      theme: {
        themeColor: 'red',
      },
      user: {
        name: 'xiaoming',
      },
    };
  }
  render() {
    const { theme, user } = this.state;
    return (
      <div>
        <h3>ContextPage</h3>
        <ThemeProvider value={theme}>
          <UserProvider value={user}>
            <HomePage />
            <ConsumerPage />
          </UserProvider>
        </ThemeProvider>
      </div>
    );
  }
}
